<template>
  <div>
    <input type="text" v-model="val" />
    <ul>
      <li v-for="i in get">{{i}}</li>
    </ul>
  </div>
</template>
<script>
export default {
  data() {
    return {
      arr: ["阿迪鞋子", "耐克鞋子", "安踏鞋子", "361度鞋子"],
      val: "",
    };
  },
  computed: {
    get() {
        var arrnew=[]
      this.arr.forEach((item) => {
         if(this.val){
             if(item.indexOf(this.val)!=-1){
                  arrnew.push(item)
             }
         }
      });
      return  arrnew;
    },
  },
};
</script>
